<extend name="Public:template" />
<block name="page_body">
<include file="Public:header_productsearch"/>
<!-- 功能导航 -->
	<div class="row text-center mt15">
		<div class="col-xs-3 col-sm-3 plr15">
			<a href="#" id="cateBtn" class="cateSearchActBtn" >
				<div class="text-center"><img class="img-responsive"  src="__ROOT__/statics/mobile/images/nav_cate.jpg"></div>商品分类
			</a>
		</div>
		<div class="col-xs-3 col-sm-3 plr15">
			<a href="{:U('CustOrder/index',array('order_status'=>'dealing'))}" id="orderBtn">
				<div class="text-center "><img class="img-responsive"  src="__ROOT__/statics/mobile/images/nav_order.jpg"></div>我的订单
			</a>
		</div>
		<div class="col-xs-3 col-sm-3 plr15">
			<a href="{:U('Cart/index')}" id="cartBtn" name="cartBtn">
				<div class="text-center "><img class="img-responsive" src="__ROOT__/statics/mobile/images/nav_cart.jpg"></div>购物车
			</a>
		</div>
		<div class="col-xs-3 col-sm-3 plr15">
			<a href="{:U('Cust/index')}" id="custBtn" name="custBtn">
				<div class="text-center "><img class="img-responsive"  src="__ROOT__/statics/mobile/images/nav_user.jpg"></div>我的地盘
			</a>
		</div>
	</div>
	
	
	<h4 class="lht40 redGraRevBg mt15" align="right">乐食居&nbsp;&nbsp;</h4>
	<div class="row text-center mt5">
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('cate_code'=>'A203'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_jkls.jpg"></a></div>
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Tuangou/index',array('cate'=>'A302'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_jksg.jpg"></a></div>
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('cate_code'=>'A103'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_xxls.jpg"></a></div>
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('cate_code'=>'A101'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_fbss.jpg"></a></div>
	</div>
	<div class="col-xs-12 col-sm-12 "><a href="{:U('Product/index',array('cate_code'=>'A107'))}" class="btn btn-block btn-default alert-danger"><h3>坚果 + 梅子 火爆促销中☞☞☞☞</h3></a></div>
	<h4 class="lht40 blueGraBg mt15">&nbsp;&nbsp;畅饮吧</h4>
	<div class="row text-center mt5">
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('cate_code'=>'B102'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_ylgz.jpg"></a></div>
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('cate_code'=>'B104'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_rzyp.jpg"></a></div>
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('cate_code'=>'B105'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_pjbj.jpg"></a></div>
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('cate_code'=>'B101'))}"><img class="img-thumbnail" src="__ROOT__/statics/mobile/images/cate_pzsy.jpg"></a></div>
	</div>
	
	<h2 class="lht40 greenGraRevBg mt15" align="right">家用区&nbsp;&nbsp;</h2>
	<ul class="list-group">
		<li class="list-group-item" onclick="searchProd('A104')">厨房调料<span class="pull-right icon icon-chevron-right"></span></li>
		<li class="list-group-item" onclick="searchProd('A105')">粮油米面<span class="pull-right icon icon-chevron-right"></span></li>
		<li class="list-group-item" onclick="searchProd('C101')">厨卫清洁<span class="pull-right icon icon-chevron-right"></span></li>
		<li class="list-group-item" onclick="searchProd('C102')">个人洗护<span class="pull-right icon icon-chevron-right"></span></li>
		<li class="list-group-item" onclick="searchProd('C103')">日杂其他<span class="pull-right icon icon-chevron-right"></span></li>
	</ul>
	<present name="hotProd">
		<div class="row text-center mt5">
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('spread'=>'new'))}"><img class="img-thumbnail" src="http://imgout.ph.126.net/22008029/link_xp.jpg"></a></div>
			<div class="col-xs-6 col-sm-6" style="padding:5px 5px;"><a href="{:U('Product/index',array('spread'=>'rmd'))}"><img class="img-thumbnail" src="http://imgout.ph.126.net/22008031/link_rx.jpg"></a></div>
		</div>
	</present>

	<h4 class="lht40 yellowGraBg mt15">&nbsp;&nbsp;最新预购商品</h4>
	<ul class="list-group">
		<volist name="tgProdList" id="val">
		<li class="list-group-item" onclick="redirect('{:U('Tuangou/showDetail',array('prod_id'=>$val['prod_id']))}')">{$val.name}<span class="pull-right icon icon-chevron-right"></span></li>
		</volist>
		
	</ul>
	<h2 class="lht40 redGraRevBg mt15" align="right">订餐区和预定区&nbsp;&nbsp;</h2>
	<div class="row">
		<div class="media col-xs-12 col-sm-12 text-center">
			<div class=" col-xs-6 col-sm-6" style="padding:0 5px;">
				<a href="#" onclick="return false;">
	  				<img class="img-thumbnail"  src="http://imgout.ph.126.net/22008028/link_wc.jpg">
				</a>
				<p>开灶在即，敬请期待</p>
			</div>
			<div class=" col-xs-6 col-sm-6" style="padding:0 5px;">
				<a href="{:U('Tuangou/index')}" >
	  				<img class="img-thumbnail"  src="http://imgout.ph.126.net/22011042/link_yg.jpg">
				</a>
				<p>为保证商品质量，预定商品最快可次日送达</p>
			</div>
		</div>
	</div>

</block>
<block name="script_footer">
<script type="text/javascript">
function addToCart(prod_id,num,edittype){
	//问题 直接在底部不加载数据了
	//document.location.href = "/cart/doadd.html?prod_id="+prod_id+"&num="+num+"&edittype="+edittype;
	$.ajax({
		'async': false, 
        'url': "/cart/doadd.html",
        'dataType': "json",
        'data': {'prod_id':prod_id,'num':num,'edittype':edittype},
        'success': function (data) {
        	if(data['error']=='0'){
            	var cart_num = data['cart_num'];
            	var item_num = data['item_num'];
            	$("#cartNum").html(cart_num);
            	$("#hotProdNum"+prod_id).html("×"+item_num);
            	$("#hotProdNum"+prod_id).addClass('badge');
            	if(data['message']!=""){
            		alert(data['message']);
            	}
        	}else{
        		alert(data['message']);
        	}
        }
    });
}

</script>
</block>